﻿@model string

@{
    ViewBag.Title = "Private chat room";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>MyCryptoChat</h2>
<div style="margin-bottom: 20px;">Chat with friends without anyone spying on what you say!</div>

<div id="chatroom" style="background: white; border: 1px solid gray; height: 300px; width: 90%; margin-top: 20px; margin-bottom: 5px; padding: 10px; overflow: auto;"></div>
<div style="font-size: 0.9em; margin-bottom:5px; width: 90%; text-align: center; padding-left: 10px; padding-right: 10px;"><span id="nbUsers">1</span> user(s) online</div>

<div>
    Name:
    <input type="text" id="userName" /><br />
    <textarea id="textMessage" onkeydown="if (event.keyCode == 13 && !event.shiftKey) { sendMessage(); }" style="max-width: 90%;"></textarea><br />
    <input type="button" value="Send" id="sendMessage" onclick="sendMessage();" />
</div>

@section scripts{
    <script type="text/javascript">
        var roomId = "@Model";
        var dateLastGetMessages = "@DateTime.UtcNow.AddDays(-100)";
    </script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/Crypto/compressedCrypto.js")"></script>
    @Scripts.Render("~/bundles/mycryptochat")
}